<?php
/**
 * Created by PhpStorm.
 * User: renyi
 * Date: 2017/4/7
 * Time: 下午14:48
 */

namespace App\Base;

trait CommonPoolMethod
{
    // --------------------------------------------------------------------------------------------
    // 快捷方法
    // --------------------------------------------------------------------------------------------

    protected function service($name)
    {
        return CommonPool::instance()->createService($name);
    }

    protected function talk($name)
    {
        return CommonPool::instance()->createTalk($name);
    }

    protected function repo($name)
    {
        return CommonPool::instance()->createRepository($name);
    }

    protected function model($key)
    {
        return CommonPool::instance()->createModel($key);
    }

    protected function remember($key, $value)
    {
        CommonPool::instance()->saveParams($key, $value);
    }

    protected function recall($key)
    {
        return CommonPool::instance()->getParams($key);
    }

    protected function forget($key)
    {
        CommonPool::instance()->removeParams($key);
    }
}